/* **********************************************************************************
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* This source code is subject to terms and conditions of the Shared Source License
* for DSL Editor PowerToy. A copy of the license can be found in the License.htm file
* at the root of this distribution. If you can not locate the Shared Source License
* for DSL Editor PowerToy, please obtain a copy from: http://www.codeplex.com/dsltreegrideditor/Project/License.aspx.
* By using this source code in any fashion, you are agreeing to be bound by
* the terms of the Shared Source License for DSL Editor PowerToy.
*
* You must not remove this notice, or any other, from this software.
*
* **********************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace DslEditorPowerToy.Controls.VirtualTreeGrid.Branches
{
    /// <summary>
    /// Interface that is used to define dataItem operations used by all branches in this control
    /// </summary>
    /// <remarks>This interface is external to the control and soley provides methods for consumers to use to gain access to underlying dataItem.</remarks>
    public interface IDataItemBranch
    {
        /// <summary>
        /// Returns the dataItem item at the specified row in branch
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        object GetDataItem(int row);
        /// <summary>
        /// Returns the name of the property of the dataItem item at the specified column
        /// </summary>
        /// <param name="column"></param>
        /// <returns></returns>
        string GetDataItemPropertyName(int column);
        /// <summary>
        /// Gets the current value of the property of the dataItem item at the specified column
        /// </summary>
        /// <param name="row"></param>
        /// <param name="column"></param>
        /// <returns></returns>
        object GetDataItemPropertyValue(int row, int column);
        /// <summary>
        /// Returns the validation error for the specified property and value
        /// </summary>
        /// <param name="propertyName"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        string GetDataItemValidationMessage(string propertyName, string value);
        /// <summary>
        /// Removes item from branch dataItem
        /// </summary>
        /// <param name="row"></param>
        bool RemoveDataItem(int row);
        /// <summary>
        /// Changes order of branch dataItem
        /// </summary>
        /// <param name="fromRow"></param>
        /// <param name="toRow"></param>
        bool MoveDataItem(int fromRow, int toRow);
        /// <summary>
        /// Returns the flags for the current dataItem item
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        DataItemFlags GetDataItemFlags(int row);
        /// <summary>
        /// Notifies the branch that the row selection has changed
        /// </summary>
        /// <param name="row"></param>
        void OnDataItemSelectionChanged(int row);
    }
}
